<?php
	class Provinsi_Model extends CI_Model {

		function __construct(){
			parent::__construct();
		}
		
		function read(){	
			$query = $this->db->get('provinsi');
			return $query->result();
		}

		function add($data){
			$query = $this->db->insert('provinsi', $data);
			return $query;
		}
		
		function edit($id){
			$this->db->where('id_provinsi',$id);
			$query=$this->db->get('provinsi');
			return $query->row();
		}
		
		function update($id_provinsi,$data){
			$this->db->where('id_provinsi', $id_provinsi);
			$update = $this->db->update('provinsi', $data);
			return $update;
		}
		
		function delete($id_provinsi){
			$this->db->where('id_provinsi', $id_provinsi);
			$delete = $this->db->delete('provinsi');
			return $delete;
		}
	}
?>